﻿/*
 *	Copyright (c) 2009 Queensland University of Technology. All rights reserved.
 *	The QUT Bioinformatics Collection is open source software released under the 
 *	Microsoft Public License (Ms-PL): http://www.microsoft.com/opensource/licenses.mspx.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using QUT.Bio.SilverMap;
using QUT.Bio.SilverMap.DefaultProvider;

namespace SilverMap {
	/// <summary>
	/// Hosts a minimal SilverMap application that sources data from the QUT test repository.
	/// </summary>
	
	public partial class Page : UserControl {
		private DataProvider webLoader;

		/// <summary>
		/// Initialises this application.
		/// </summary>
		
		public Page () {
			InitializeComponent();
			map.Initialize( overlay );
			map.VerticalAlignment = VerticalAlignment.Stretch;
			map.View.GraphView.Canvas.MaximumScale = 12;
			webLoader = new DataProducer( overlay );
			loadFromWeb.Action += LoadFromWeb;
		}

		/// <summary>
		/// Event handler for the Open (MQUTeR) tool.
		/// </summary>
		private void LoadFromWeb () {
			map.Model.DataProducer = webLoader;
			webLoader.DisplayLoadDialog();
		}
	}
}
